home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Msgboxes.pxl < prev    next >
Text File  |  1999-11-05  |  7KB  |  196 lines

  1. Initialize:
  2.     Title$ = "Introducing MessageBoxes"
  3.     UseCaption(Title$)
  4.     UseCoordinates(PIXEL)
  5.     SetColorPalette(BITMAP)
  6.     UseBackground(TRANSPARENT,166,166,166)
  7.     DrawBackground
  8.     WinLocate(Title$,200,100,720,620,Res)
  9.     WinShow(Title$,NOTOPMOST,Res)
  10.     DirGet(SourceDir$)
  11.  
  12.     WinShow(Title$,TOPMOST,Res)
  13.     InfoMenu(REMOVE)
  14.     WaitInput(100)  
  15.     SetMenu("E&xit!",Leave,
  16.         ENDPOPUP,
  17.         "&Standard Icon Styles",IGNORE,
  18.         "&One Button",One_Button,
  19.         SEPARATOR,
  20.         "&Two Buttons",Two_Button,
  21.         SEPARATOR,
  22.         "T&hree Buttons",Three_Button,
  23.         ENDPOPUP,
  24.         "&Built-in Icon Styles",IGNORE,
  25.         "&One, Two and Three Button",PXL_One_Button,
  26.         ENDPOPUP,
  27.         "&Help",IGNORE,
  28.         "&Concept",Concept,
  29.         "&About",About,
  30.         ENDPOPUP)
  31.  
  32.         Goto Concept
  33.  
  34.  
  35. Wait_for_Input: 
  36.     WaitInput()
  37.  
  38. Leave:
  39.     End
  40.  
  41. About:
  42.     AboutUser("About MessageBoxes",
  43.     "Learning the PiXCL Language Sample",
  44.     "Shows the various types of MessageBox icon and button styles available in PiXCL.")
  45.     Goto Wait_for_Input
  46.  
  47. Concept:
  48.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  49.     DrawBackground
  50.     UseFont("Arial",13,29,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  51.     DrawText(16,16,"The Windows MessageBox")
  52.     UseFont("Arial",13,29,NOBOLD,NOITALIC,NOUNDERLINE,255,255,255)
  53.     DrawText(15,15,"The Windows MessageBox")
  54.  
  55.     UseFont("Arial",7,0,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  56.     cx1 += 10  cx2 -= 10    cy1 += 70
  57.     DrawTextExt(cx1,cy1,cx2,cy2,
  58. "The Messagebox is the most commonly used Windows dialog, and is used when you want to display information and retrieve an action as selected with one of up to three push buttons. 
  59.  
  60. You can also display one of a standard set of icons, or one a set of icons built into PiXCL, to define the type of messagebox, and set the string that appears in the messagebox title bar.
  61.  
  62. Messageboxes appear centralised in your Windows screen, and use the system default text font that is also used with the menu. This font cannot be changed from within PiXCL.
  63.  
  64. Click on the menu items above to see the various types of Messagebox available to you with the PiXCL language.",
  65.     LEFT)
  66.  
  67.     Goto Wait_for_Input    
  68.  
  69. PXL_One_Button:
  70.     MessageBox(OKCANCEL,1,ICON01,
  71. "PiXCL has twenty-one built-in icons that can be used in the MessageBox 
  72. command, when the system icons are not appropriate for your program.
  73.  
  74. This is  icon #01, and is the default icon that appears in the task bar when 
  75. you minimize the window, and in the PiXCL title bar as the system button.
  76.  
  77. See also the DrawIcon command.  If you have an icon editor, you can set
  78. this up in the PiXCL MDI Editor preferences, and replace any of the icons,
  79. so long as they are 32x32 pixels.
  80.  
  81. All MessageBoxes can have up to three buttons.",
  82.     "Other Icons",Res)
  83.     If Res = 2 Then Goto Wait_for_Input
  84.     MessageBox(OK,1,ICON02,"PiXCL icon #02. Use to prompt for floppy to hard disk transfers.","Other Icons",Res)
  85.     MessageBox(OK,1,ICON03,"PiXCL icon #03.  Use when a CD-ROM operation needs a prompt. ","Other Icons",Res)
  86.     MessageBox(OK,1,ICON04,"PiXCL icon #04.  A folder icon.","Other Icons",Res)
  87.     MessageBox(OKCANCEL,1,ICON05,
  88.     "PiXCL icon #05. This is the PXL_make Runtime builder icon.",
  89.         "Other Icons",Res)
  90.     If Res = 2 Then Goto Wait_for_Input
  91.     MessageBox(OK,1,ICON06,"PiXCL icon #06. Draw with a pencil.","Other Icons",Res)
  92.     MessageBox(OK,1,ICON07,"PiXCL icon #07. Hard disk operation.","Other Icons",Res)
  93.     MessageBox(OK,1,ICON08,"PiXCL icon #08. Floppy or removable disk operation.","Other Icons",Res)
  94.     MessageBox(OK,1,ICON09,"PiXCL icon #09. Look up reference manuals.","Other Icons",Res)
  95.     MessageBox(OK,1,ICON10,"PiXCL icon #10.  Prompt for a floppy disk.","Other Icons",Res)
  96.     MessageBox(YESNO,1,ICON11,"PiXCL icon #11. Property page or text document.","Other Icons",Res)
  97.     If Res = 2 Then Goto Wait_for_Input
  98.     MessageBox(OK,1,ICON12,
  99.     "PiXCL icon #12. This is the PiXCL Help icon.",
  100.         "Other Icons",Res)
  101.     MessageBox(OK,1,ICON13,"PiXCL icon #13. Paint tool icon.","Other Icons",Res)
  102.     MessageBox(OK,1,ICON14,"PiXCL icon #14. Draw tool icon.","Other Icons",Res)
  103.     MessageBox(OK,1,ICON15,"PiXCL icon #15. Another draw tool icon.","Other Icons",Res)
  104.     MessageBox(YESNOCANCEL,1,ICON16,
  105.     "PiXCL icon #16. Reserved for the DropFileServer command.",
  106.         "Other Icons",Res)
  107.     If Res = 3 Then Goto Wait_for_Input
  108.     MessageBox(OK,1,ICON17,
  109.     "PiXCL icon #17. Reserved for the DropFileServer command.",
  110.         "Other Icons",Res)
  111.     MessageBox(OK,1,ICON18,"PiXCL icon #18.  Dropfile server Icon.","Other Icons",Res)
  112.     MessageBox(OK,1,ICON19,
  113.     "PiXCL icon #19. This is the 'printing-in-progress' icon.",
  114.         "Other Icons",Res)
  115.     MessageBox(OK,1,PXLHISTOGRAM,"PiXCL histogram icon","Other Icons",Res) 
  116.     MessageBox(OK,1,PXLTOOLBAR,"PiXCL toolbar icon","Other Icons",Res) 
  117.  
  118.     Goto Wait_for_Input
  119.  
  120. One_Button:
  121.     MessageBox(OK,1,WINLOGO,
  122. "Windows Logo. This can be used when you want to display a message
  123. that refers to Windows directly. ",
  124.         "Windows Message", Res)
  125.     MessageBox(OK,1,APP,
  126.     "This icon is generally used to supply information about an application.",
  127.     "Application Icon", Res)
  128.  
  129.  
  130.     MessageBox(OK,1,INFORMATION,
  131. "MessageBoxes can be like this one ... informative. 
  132. This could be simple help for menu operations, or 
  133. program property information.",
  134.     "Information Box",Res)
  135.  
  136.     MessageBox(OK,1,NOICON,
  137. "or like this one with no icon at all. It can be used
  138. for general information. MessageBoxes can have 
  139. one, two or three buttons,  combining either 
  140. 'OK', 'YES', 'NO' or 'CANCEL' labels.",
  141.     "No Icon Box",Res)
  142.  
  143.     Goto Wait_for_Input
  144.  
  145. Two_Button:
  146.     MessageBox(OKCANCEL,1,EXCLAMATION,
  147. "or like this one ... a bit more emphasis. Perhaps you
  148. need to remind your user that an action is about to occur.",
  149.     "Exclamation Box",Res)
  150.  
  151.     MessageBox(YESNO,1,QUESTION,
  152. "or like this one ... asking you what to do now. You will
  153. use this type of message box very often. And it is all easily
  154. programmable with one simple command.",
  155.     "Question Box",Res)
  156.  
  157.     MessageBox(RETRYCANCEL,1,QUESTION,
  158. "or like this one ... retry some operation that did not 
  159. complete as expected. Actions involving floppy disks 
  160. or CD-ROMs will often require this type of message.",
  161.     "Retry-Cancel Box",Res)
  162.  
  163.     Goto Wait_for_Input
  164.  
  165. Three_Button:
  166.     DirGetWindows(WinDir$)
  167.     Themic$ = WinDir$ + "\media\The Microsoft Sound.wav"
  168.     FileExist(Themic$,Res)
  169.     If Res = 1 Then WAVPlaySound(Themic$,ASYNC,FILENAME,Res)
  170.     MessageBox(YESNOCANCEL,1,STOP,
  171. "or like this one ... when something has gone wrong. 
  172. You can include an audible message too.  If your PC 
  173. has a sound card you should have heard the standard
  174. Microsoft sound ! You can use your own WAV files as 
  175. well.",
  176.     "Stop Box",Res)
  177.  
  178. Blah_3:
  179.     MessageBox(ABORTRETRYIGNORE,3,QUESTION,
  180. "Need a MessageBox like this one ? Press IGNORE to keep on with the demo. Press the other buttons and see what happens.",
  181.     "Another style with three buttons",Res)
  182.     Msg$ = "Use this option when a process such as
  183. floppy disk access needs to be stopped."
  184.     If Res = 1 Then MessageBox(OK,1,INFORMATION,Msg$,"Abort button pressed",Res) Goto Blah_3
  185.     Msg$ = "Use this option when a process such as
  186. floppy disk access needs to be retried."
  187.     If Res = 2 Then MessageBox(OK,1,INFORMATION,Msg$,"Retry button pressed",Res) Goto Blah_3
  188.  
  189.  
  190.     Goto Wait_for_Input
  191.  
  192.  
  193.  
  194.  
  195.  
  196.